package com.yowasa.xiuxian.engine.item.lingyao;

import com.yowasa.xiuxian.annoations.Item;
import com.yowasa.xiuxian.engine.HoneEngine;
import com.yowasa.xiuxian.engine.hone.MentalInterface;
import com.yowasa.xiuxian.engine.item.ItemInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ItemTypeEnum;
import com.yowasa.xiuxian.exception.HandlerException;

import java.util.List;

@Item(name = "太上忘情丹", type = ItemTypeEnum.LING_YAO, price = 10000)
public class TaiShangWangQingDan implements ItemInterface {

    @Override
    public String desc() {
        return "忘却当前所学心法和其对应的战技，已装配战技仍可使用，但卸下战技后无法重新装配";
    }

    @Override
    public String effect(UserBO userBO) {
        if (userBO.getUserConfig().isXiuLianFlag()) {
            throw new HandlerException("正在修炼，无法使用");
        }
        MentalInterface mental = HoneEngine.mentalMap.get(userBO.getUserConfig().getMental());

        List<String> strings = mental.bsList();
        userBO.getUserConfig().getCanStudyStrategies().removeAll(strings);
        userBO.getUserConfig().getStudiedStrategies().removeAll(strings);

        userBO.getUserConfig().setMental(null);

        return "忘却了当前心法的一切";
    }




}
